home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / ForCLI / heads.readme < prev    next >
Text File  |  1996-09-26  |  4KB  |  78 lines

  1. Short:        AREXX for first/last/both ends of a file
  2. Author:       Herbert Wollman   hwollman@mitre.org
  3. Uploader:     Herbert Wollman   hwollman@mitre.org
  4. Type:         util/cli
  5. Requires:     util/libs/rexxarplib.library
  6. Distribution: All
  7.  
  8. Heads.doc    Documentation for head, tail, and ends
  9. 3 AREXX programs for viewing the first/last/both ends of a file.
  10.  
  11. Herbert Wollman,  Telephone (617) 272-2994
  12. 5 Fowler Ter, Burlington, MA 01803, USA.
  13. E-mail at hwollman@mitre.org
  14.  
  15. Head and tail are handy utilities for viewing the first and last lines 
  16. respectively of files.  They are a standard part of any UNIX computer, and 
  17. have been ported to many other computer systems.  Their default behavior is 
  18. to copy the first (or last, respectively) 10 lines from Standard Input to 
  19. Standard Output.  However, like most UNIX commands, command line options 
  20. can make them much more versatile. The usage is,
  21.  
  22. head [ -LineCount ] [ File ] [ OtherFiles... ]
  23. tail [ -LineCount ] [ File ] [ OtherFiles... ]
  24. ends [ -LineCount ] [ File ] [ OtherFiles... ]
  25.  
  26. If the first command line parameter is a negative integer, it will specify 
  27. the number of lines copied.  If the LineCount parameter is missing, it will 
  28. default to 10.  Any other parameters are the names of files to read instead 
  29. of Standard Input.  If more than one file is specified, the filename will 
  30. appear before each new set of lines listed. 
  31.  
  32. Head and tail are standard utilities, usually written in C, available on all 
  33. UNIX computers.  My Amiga versions, head.rexx, and tail.rexx included in 
  34. this archive are written in AREXX.  Head.rexx is functionally identical to 
  35. the version I use at work on Silicon Graphics workstations.  The UNIX 
  36. version of tail allows only one file to be specified, but my Amiga version 
  37. allows multiple files, just as head does.  
  38.  
  39. Occasionally you want to view both the beginning and end of a file.  For 
  40. this I have written the program ends.rexx, which has no direct UNIX 
  41. equivalent.  The syntax for ends is the same as for head or tail.  It will 
  42. show the first and last lines of each file, separated by a line of ...
  43.  
  44. On a UNIX computer the shell expands wildcards in the filenames on the 
  45. command line prior to passing it to a program.  Hence the head program 
  46. would receive one command parameter for each file that it has to read.  
  47. However, on the Amiga, neither the standard AmigaShell, nor the WShell 
  48. (which I use), perform wildcard expansion.  Therefore each program must do 
  49. its own filename expansion.  To do this, I use the FileList() function in 
  50. the rexxarplib.library, which must be located in the LIBS: directory.  
  51.  
  52. I have included two smaller and faster versions of head, which only perform 
  53. the default operation, and hence do not accept command line options.  
  54. Defhead.rexx (Defaulthead) is a 2 line, 158 byte program in AREXX.  In 
  55. contrast, the full version of head.rexx, which can handle any number of 
  56. filename patterns on the command line, each of which can expand into many 
  57. names, is relatively large, i.e., 1290 bytes, and 59 lines.  
  58.  
  59. Fhead.f is the one line source code for Fhead (Falsehead), which is written 
  60. in "False."  The compiled executable is only 312 bytes.  False is a 
  61. wonderful "toy" language written by Wouter van Oortmerssen, and available 
  62. on Fish Disk 885.  It is perfect for this type of application, at least if 
  63. you like compact obscure code.  
  64.  
  65. All of the program files in this archive are released into the public 
  66. domain, however I request that if you redistribute them, please keep them 
  67. together with this doc file.  If you wish to contact me, I can be reached 
  68. via the Boston Computer Society, Amiga Bulletin Board (617) 729-7340, or by 
  69. E-mail at hwollman@mitre.org
  70.  
  71.  
  72. ============================= Archive contents =============================
  73.  
  74. Original  Packed Ratio    Date     Time    Name
  75. -------- ------- ----- --------- --------  -------------
  76. -------- ------- ----- --------- --------
  77.        0       0  0.0% 17-Nov-95 16:33:32   0 files
  78.